package com.example.demo.controller;

import com.example.demo.service.LogoutService;
import com.example.demo.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LogoutController {

    @Autowired
    private LogoutService logoutService;

    @GetMapping("/logout")
    public Result logout(@RequestHeader("Authorization") String token){
        System.out.println("!!!!!" + token);
        return logoutService.logout(token);
    }
}
